﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace GrayParrot.Web.Formly
{
    /// <summary>
    /// The DateTime Picker Widget Rendering Modes...
    /// </summary>
    public enum DateTimeRenderingModes
    {
        /// <summary>
        /// The datetime picker widget is rendered like a dropdown...
        /// </summary>
        DropDown = 0,
        /// <summary>
        /// The datetime picker widget is rendered inline ( like calendar )...
        /// </summary>
        Inline
    }

    /// <summary>
    /// The DateTime Template Options Attribute...
    /// </summary>
    public class DateTimeTemplateOptionsAttribute : TemplateOptionsAttribute
    {
        /// <summary>
        /// Gets or sets the minimum view.
        /// </summary>
        /// <value>
        /// The view that will trigger date selection when the user clicks on one of the date/time values.
        /// </value>
        /// <remarks>Default: minute</remarks>
        [JsonProperty(PropertyName = "minView", DefaultValueHandling = DefaultValueHandling.Ignore)]
        public string MinView { get; set; }

        /// <summary>
        /// Gets or sets the start view.
        /// </summary>
        /// <value>
        /// The view that the datetimepicker should show when it is opened.
        /// </value>
        /// <remarks>
        /// Default: day
        /// 
        /// Accepts values of :  
        /// 
        /// minute
        /// for the minute view
        ///
        /// hour
        /// for the hour view
        /// 
        /// day
        /// for the day view (the default)
        /// 
        /// month
        /// for the month view (12-months of the selected year)
        /// 
        /// year
        /// for the year view (12-year range)
        /// </remarks>
        [JsonProperty(PropertyName = "startView", DefaultValueHandling = DefaultValueHandling.Ignore)]
        public string StartView { get; set; }

        /// <summary>
        /// Gets or sets the minute step.
        /// </summary>
        /// <value>
        /// The increment used to build the hour view. A button is created for each minuteStep minutes.
        /// </value>

        [JsonProperty(PropertyName = "minuteStep", DefaultValueHandling = DefaultValueHandling.Ignore)]
        public short MinuteStep { get; set; }

        /// <summary>
        /// Gets or sets the dropdown selector.
        /// </summary>
        /// <value>
        /// When used within a Bootstrap dropdown, the selector specified in dropdownSelector will toggle the dropdown when a date/time is selected.
        /// </value>
        /// <remarks>Default: null</remarks>
        [JsonProperty(PropertyName = "renderMode", DefaultValueHandling = DefaultValueHandling.Ignore)]
        public DateTimeRenderingModes RenderingMode { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="DateTimeTemplateOptionsAttribute"/> class.
        /// </summary>
        public DateTimeTemplateOptionsAttribute()
        {

        }
    }
}
